
package com.qdu.servlet;

import com.qdu.entity.Note;
import com.qdu.service.NoteService;
import com.qdu.service.impl.NoteServiceImpl;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 *
 * @author 12068
 */
@WebServlet("/zzz")
public class AddNoteServlet extends HttpServlet{
    NoteService ss= new NoteServiceImpl();
     @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {

        
        req.setCharacterEncoding("utf-8");
        int Uno = Integer.parseInt(req.getParameter("Uno"));
        String Uname = req.getParameter("Uname");
        int Nno = Integer.parseInt(req.getParameter("Nno"));
        String Nst = req.getParameter("Nst");
        String Ntopic = req.getParameter("Ntopic");
        String Nnr = req.getParameter("Nnr");

    

        Note newNote = new Note(Uno,Uname,Nno,Nst,Ntopic,Nnr);
        int rows =  ss.addNote(newNote);
     
        resp.getWriter().println(rows);
}
}
